package top.kaoshanji.p1ch04a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.text.MessageFormat;
import java.util.Date;
import java.util.ResourceBundle;

/**
 * 代码清单 p1ch04a-16：区域设置类别的使用示例
 * author kaoshanji
 * ^_^
 * create time 2025/1/16 18:18
 */
public class ResourceBundleExample03 {

    private static final Logger logger = LogManager.getLogger(ResourceBundleExample03.class);

    public static void main(String[] args) {
        logger.info("...代码清单 p1ch04a-16：区域设置类别的使用示例...");

        ResourceBundle bundle = ResourceBundle.getBundle("p1ch04a16/Messages");
        String str = bundle.getString("GREETING");
        String msg = MessageFormat.format(str, new Object[] {"李四", new Date()});
        logger.info("...msg:{}...", msg);

    }

}
